package cn.edu.buu.hospital.entity;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 病单报告实体类
 */
public class Report implements Serializable {
    // 病单号（主键，唯一且自增）
    private Long reportid;
    // 用户ID（外键，关联user表）
    private Long userid;
    // 预约ID（外键，关联appointment表）
    private Long appointmentid;

    
    // 症状描述
    private String symptoms;
    // 医生建议
    private String doctoradvice;
    // 生成时间
    private LocalDateTime createtime;
    // 创建时间字符串（兼容字段）
    private String createTime;
    
    // 关联的用户信息
    private User user;
    // 关联的预约信息
    private Appointment appointment;

    // 无参构造方法
    public Report() {
    }

    // 全参构造方法
    public Report(Long reportid, Long userid, Long appointmentid, String symptoms, String doctoradvice, LocalDateTime createtime) {
        this.reportid = reportid;
        this.userid = userid;
        this.appointmentid = appointmentid;
        this.symptoms = symptoms;
        this.doctoradvice = doctoradvice;
        this.createtime = createtime;
    }

    // getter和setter方法
    public Long getReportid() {
        return reportid;
    }

    public void setReportid(Long reportid) {
        this.reportid = reportid;
    }

    public Long getUserid() {
        return userid;
    }

    public void setUserid(Long userid) {
        this.userid = userid;
    }

    public Long getAppointmentid() {
        return appointmentid;
    }

    public void setAppointmentid(Long appointmentid) {
        this.appointmentid = appointmentid;
    }
    


    public String getSymptoms() {
        return symptoms;
    }

    public void setSymptoms(String symptoms) {
        this.symptoms = symptoms;
    }

    public String getDoctoradvice() {
        return doctoradvice;
    }

    public void setDoctoradvice(String doctoradvice) {
        this.doctoradvice = doctoradvice;
    }

    public LocalDateTime getCreatetime() {
        return createtime;
    }

    public void setCreatetime(LocalDateTime createtime) {
        this.createtime = createtime;
    }
    
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
    
    public Appointment getAppointment() {
        return appointment;
    }

    public void setAppointment(Appointment appointment) {
        this.appointment = appointment;
    }
    
    public void setAppointmentId(Long appointmentId) {
        this.appointmentid = appointmentId;
    }
    
    public Long getAppointmentId() {
        return this.appointmentid;
    }
    
    public void setUserId(Long userId) {
        this.userid = userId;
    }
    
    public Long getUserId() {
        return this.userid;
    }
    
    public void setDoctorAdvice(String doctorAdvice) {
        this.doctoradvice = doctorAdvice;
    }
    
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
    
    public String getCreateTimeString() {
        return createTime;
    }
    
    // 为了兼容JSP页面中的属性名
    public Long getReportId() {
        return getReportid();
    }

    // toString方法
    @Override
    public String toString() {
        return "Report{" +
                "reportid=" + reportid +
                ", userid=" + userid +
                ", appointmentid=" + appointmentid +
                ", symptoms='" + symptoms + '\'' +
                ", doctoradvice='" + doctoradvice + '\'' +
                ", createtime=" + createtime +
                ", user=" + user +
                ", appointment=" + appointment +
                '}';
    }
}